package influence.propagation.implementation;

import influence.propagation.core.NodeModel;
import influence.propagation.implementation.independent.cascade.IndependentCascadeEvaluator;

import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.traversal.Evaluator;

public class IndependentCascadeModel extends AbstractModel {

	protected IndependentCascadeModel(GraphDatabaseService db) {
		super(db);
	}

	@Override
	protected NodeModel createNewActiveNode(Node node) {
		IndependentCascadeActiveNode myNode = new IndependentCascadeActiveNode();
		myNode.addProperty(ActiveNodeProperties.ID,
				node.getId());
		String name = (String) node
				.getProperty(ActiveNodeProperties.NAME
						.toString());
		myNode.addProperty(ActiveNodeProperties.NAME,
				name);
		return myNode;
		
	}

	@Override
	protected Evaluator getEvaluator() {
		return new IndependentCascadeEvaluator();
	}
}
